#pragma once
#include "ComPorts.h"
#include "I2C_LM75.h"
#include "I2C_PCF8574.h"
#include "ftd232.h"
#include "DataOutput.h"
#include "tcp_connection.h"
#include "tcp_server.h"

class ControlUnit
{
	HWND hWnd;

public:

	unsigned long startTime;
	unsigned long heatTime;
	unsigned long heatLength;
	unsigned long downTime;
	unsigned long breakTime;

	unsigned long CheckPeriod;

	float TemperatureDiff_In;

	float Temp_Out;
	float Temp_Pumpe_Anlauf;

	float T_atHour[24];
	
	float PumpTimeAtHour[24];

	float DayHeatDurate;

	bool PumpON;

	I2C_PCF8574* Schalter;
	I2C_LM75* T_Sensor;
	I2C_LM75* T_Sensor_In;
	I2C_LM75* T_Sensor_Pumpe_Anlauf;
	

	int cyclus; 
	ComPorts* C1;
	DataOutput* D;
	ftd232* usb_a;
	tcp_connection* tcp;
	tcp_server* tcp_srv;
	

	ControlUnit(HWND hWnd);
	~ControlUnit(void);

	void Check(void);
	unsigned long heatPulsDuration(float Temp_out, SYSTEMTIME st);
	

};
